﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/ViewMasterPage1.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ComputerShopE3.Models.LAPTOP>>" %>
<%@ Import Namespace="ComputerShopE3.Controllers" %> 

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Danh mục laptop</h2>
    <table>
        <tr>

            <% SiteRoles role = SpiderE3AuthorizeAttribute.GetCurrentRole(Context);
                if (role == SiteRoles.Admin || role == SiteRoles.Employee)
                { %>
            <th></th>    
                <%  } %>        

            <% ViewData["SanPham"] = null; %>
            <% Html.RenderPartial("ProductListPartialView"); %>
          
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
                <% if (role == SiteRoles.Admin || role == SiteRoles.Employee)
                { %>
            <td>

                    <%= Html.ActionLink("Edit", "Edit", new { id=item.id }) %>
            </td>           
                <%  } %> 
                <% ViewData["SanPham"] = item.SAN_PHAM; %>
                <% Html.RenderPartial("ProductListPartialView"); %>
            

        </tr>
    
    <% } %>

    </table>
    <p>

        <% if (role == SiteRoles.Admin || role == SiteRoles.Employee || role == SiteRoles.Member)
           { %>
            <%= Html.ActionLink("Tạo mới", "Create")%>
        <% } %>

    </p>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <title>Laptop</title>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="PersonalMenu" runat="server">
</asp:Content>
